﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataManager.DAL
{
    class Directs:DAL
    {
        /// <summary>
        /// Beszur egy uj sort.
        /// </summary>
        /// <param name="movieId"></param>
        /// <param name="directorId"></param>
        /// <returns></returns>
        public string InsertDirects(int movieId, int directorId)
        {
            string[] parameterNames = new string[2], parameterValues = new string[2];
            parameterNames[0] = "@FilmId"; parameterValues[0] = movieId.ToString();
            parameterNames[1] = "@RendezoId"; parameterValues[1] = directorId.ToString();

            return ExecuteStoredProcedureNonQuery("UjRendezte", parameterNames, parameterValues);

        }

        /// <summary>
        /// Torol egy sort.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string DeleteDirects(int id)
        {
            string query = "DELETE FROM Rendezte WHERE RendezteId = " + id;
            return ExecuteNonQuery(query);
        }
    }
}
